<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>

<base href="${base}" />
<meta charset="UTF-8" />
<title>企业会员中心 - 人才系统</title>
<link rel="shortcut icon" href="favicon.ico" />
<link href="styles/user.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="layui/css/layui.css"  media="all">
	<script src="layui/layui.js" charset="utf-8"></script>
	<script src="js/jquery-2.0.3.js"></script>
	<script>
		layui.use('layer', function(){
			var $ = layui.jquery, layer = layui.layer;
			var active = {
				notice: function () {
					//示范一个公告层
					layer.open({
						type: 1
						,
						title: false //不显示标题栏
						,
						closeBtn: false
						,
						area: '500px;'
						,
						shade: 0.8
						,
						id: 'LAY_layuipro' //设定一个id，防止重复弹出
						,
						btn: ['确定发出面试邀请', '取消']
						,
						btnAlign: 'c'
						,
						moveType: 1 //拖拽模式，0或者1
						,
						content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;" xmlns="http://www.w3.org/1999/html">请选择面试时间：<input type="datetime-local" id="time"/></br>请填写面试地点：<input type="text" id="address"/></div>'
						,
						yes: function(index, layero){
							mianshi();
							console.log($("#time").val());
							console.log($("#address").val());
							console.log(Array.from(new Set(list)));
							if (list.length!=0){
								$.ajax({
									type: "POST",
									url: "interview/add",
									contentType:"application/json",
									data: JSON.stringify({
										time:$("#time").val(),
										address:$("#address").val(),
										resumeIds: Array.from(new Set(list))
									}),
									success: function(msg){
										if (msg.code=="200"){
											location.href="interview/list/0"
										}
									}
								});
							}
						}
					});
				}
			}
			$('.layui-btn').on('click', function(){
				var othis = $(this), method = othis.data('method');
				active[method] ? active[method].call(this, othis) : '';
			});
		})
		//全选全不选
		function getAll(){
			let d = document.getElementsByName("sub");
			let a = document.getElementById("all");
			for (let i of d) {
				i.checked = a.checked;
			}
		}
		//取消全选或全不选
		function quxiao(){
			let d = document.getElementsByName("sub");
			let a = document.getElementById("all");
			var c = 0;
			for (let i of d) {
				if (i.checked) {
					c++;
				}
			}
			if (c != d.length) {
				a.checked = false;
			} else {
				a.checked = true;
			}
		}

		/**
		 * 发出面试邀请
		 */
		var list=new Array();
		function mianshi(){
			//console.log(list);
			let d = document.getElementsByName("sub");
			let a = document.getElementById("all");
			let jj = d.length
			for (let i=0;i<jj;i++) {
				if (a.checked) {
					for(let j=0;j<jj;j++){
						list.push(d[j].value);
					}
					return;
				}else if (d[i].checked){
					list.push(d[i].value);
				}
			}
			Array.from(new Set(list));
		}
	</script>
</head>
<body>
	<jsp:include page="../header.jsp"></jsp:include>
	<!--导航 -->
	<div class="floatnav">
		<jsp:include page="../nav.jsp"></jsp:include>
	</div>
	<!--导航end -->
	<div class="page_location link_bk">

		当前位置：<a href="//">首页</a>&nbsp;>>&nbsp;<a href="company/">会员中心</a>&nbsp;>>&nbsp;招聘管理
		&nbsp;>>&nbsp;收到的职位申请
	</div>
	<table width="985" border="0" align="center" cellpadding="0"
		cellspacing="0" style="margin-top: 8px;">
		<tr>
			<td width="173" valign="top" class="link_bk"><jsp:include
					page="left.jsp"></jsp:include></td>
			<td valign="top">
				<div class="user_right_box">
					<div class="user_right_top_tit_bg">
						<h1>我收到的简历</h1>
					</div>
					<div class="us_tab">
						<a href="" class="select">所有的<span>(${myresume.totalNum})</span></a> <a href="">邀请面试<span>(0)</span></a>
						<a href="">未邀请面试<span>(1)</span></a>
						<div style="padding-right: 10px; text-align: right; float: right">
							按职位查看： <select name="jobselect" id="jobselect"
								style="font-size: 12px;">
								<option value="">所有职位</option>
								<option value="1">Java程序员</option>

							</select>
						</div>
						<div class="clear"></div>
					</div>

						<table width="98%" border="0" cellpadding="0" cellspacing="0"
							align="center" class="link_lan">
							<tr>
								<td width="130" height="32" class="us_list_title"><label
									id="chkAll"><input type="checkbox" name="chkAll"
										id="all" title="全选/反选" onclick="getAll()"/>投递的简历</label></td>
								<td width="100" class="us_list_title">申请的职位</td>
								<td class="us_list_title">技能特长</td>
								<td width="60" align="center" class="us_list_title">其他</td>
								<td width="80" align="center" class="us_list_title">申请时间</td>
							</tr>
							<c:forEach items="${myresume.data}" var="resw" varStatus="s">
							<tr id="1">
								<td height="32"><input name="sub" type="checkbox"
									id="y_id" value="${resw.id}" onclick="quxiao()"/> <a href="" target="_blank">${resw.resume.realName}</a> <span
									style="color: #999999">[已看]</span></td>
								<td>${resw.work.name}</td>
								<td><span
									title="442423423423423423423423423423423<br />意向职位：电子商务"
									class="vtip">${resw.resume.skill}</span></td>
								<td align="center">无</td>

								<td align="center">${resw.sendTime}</td>
							</tr>
							<tr id="1">
								<td height="23" colspan="5" valign="top" class="us_list">
									<div style="color: #999999; padding-left: 20px;">
										性别：${resw.resume.gender}&nbsp;&nbsp;|&nbsp;&nbsp 工作经验：${resw.resume.workExp}&nbsp;&nbsp;|&nbsp;&nbsp
										学历：${resw.resume.education}&nbsp;&nbsp;|&nbsp;&nbsp
										所在地区：${resw.resume.address}&nbsp;&nbsp;|&nbsp;&nbsp 简历更新日期：${resw.resume.updateTime}</div>
								</td>
							</tr>
							</c:forEach>
						</table>
						<table width="100%" border="0" cellspacing="8" cellpadding="0">
							<tr>
								<td>
									<button data-method="notice" class="layui-btn" style="position: relative;top:10px">面试邀请</button>
								</td>
							</tr>
						</table>
						<table border="0" align="center" cellpadding="0" cellspacing="0"
							class="link_bk">
							<tr>
								<td height="50" align="center">
									<div class="page link_bk">
										<a class="" href="resumework/getresumework/1">首页</a>
										<c:if test="${myresume.currPage ne 1}">
											<a class="" href="resumework/getresumework/${myresume.currPage-1}">上一页</a>
										</c:if>
										<c:forEach var="page" begin="1" end="${myresume.totalPage}" step="1">
											<c:choose>
												<c:when test="${page eq myresume.currPage}">
													<a class="select" href="resumework/getresumework/${page}">${page}</a>
												</c:when>
												<c:otherwise>
													<a class="" href="resumework/getresumework/${page}">${page}</a>
												</c:otherwise>
											</c:choose>
										</c:forEach>
										<c:if test="${myresume.currPage ne myresume.totalPage}">
										<a class="" href="resumework/getresumework/${myresume.currPage+1}">下一页</a>
										</c:if>
										<a class="" href="resumework/getresumework/${myresume.totalPage}">尾页</a>
										<a>${myresume.currPage}/${myresume.totalPage}页</a>
										<div class="clear"></div>
									</div>
								</td>
							</tr>
						</table>
				</div>
			</td>
		</tr>
	</table>
	<jsp:include page="../footer.jsp"></jsp:include>
</body>
</html>
